<template>
  <div class="TimePage_vue">距离今天已经---{{time}}天了</div>
</template>

<script setup lang="ts">
import { onMounted, ref } from "vue";
const time = ref('')

const timestamp1 = "2023-12-06T00:00:00"; // 例如：2023年7月1日
const timestamp = new Date().getTime();
onMounted(()=>{
  const date1 = new Date(timestamp1);
  const date2 = new Date(timestamp);
  time.value = Math.floor(Math.abs(date2.getTime() - date1.getTime()) / (1000 * 60 * 60 * 24));
})
</script>

<style scoped lang="scss">
.TimePsge_vue {
}
</style>
